
login_data = [
    {"username": "13488888888", "password": "123456"},
    {"username": "", "password": "123456"},
    {"username": "13800000001", "password": ""},
    {"username": "13800000001", "password": "123"}
]
#定义函数
def login(phone, pwd):  #判断手机号与密码是否正确
    if phone == "13488888888" and pwd == "123456":
        print("登录成功")
    else:
        print("登录失败")

#调用函数login
login("","123456")

num = 1  # 计数器
for i in login_data:
  # 获取账号密码
  phone = i.get("username")
  pwd = i.get("password")
  print(f"第{num}次测试")
  # 调用函数
  login(phone, pwd)
  num += 1  # 调用一次计数器增1


  # 定义函数
  def login(phone):  #账号是否正确

      # 模拟登录
      if phone == "13488888888":
          return "账号正确"  # 判断之后的结果返回给调用者
      else:
          return "账号错误"
